﻿@model PagedList.IPagedList<MVCBlog.Models.Post>

@{
    ViewBag.Title = "Category";
}
@using PagedList.Mvc;
@using PagedList;
<h1 class="text-center">@ViewBag.CategoryName Category</h1>

@foreach (var item in Model)
{
    <div class="blogPost">
        <h2><a href="/home/article/@Html.DisplayFor(modelItem => item.ID)">@Html.DisplayFor(modelItem => item.Title)</a></h2>
        <p class="postTagline">Posted by @Html.DisplayFor(modelItem => item.AspNetUser.DisplayName) on @Html.DisplayFor(modelItem => item.PostDate) in Category: @Html.DisplayFor(modelItem => item.Category.Name)</p>
        <p>@Html.DisplayFor(modelItem => item.Summary)</p>
        <p><a href="/home/article/@Html.DisplayFor(modelItem => item.ID)">Read More ...</a></p>
        <hr />
    </div>
}
@Html.PagedListPager((IPagedList)Model, page => Url.Action("Category", new { page }))